package com.lz.test

import org.junit.runner.RunWith
import org.powermock.api.mockito.PowerMockito
import org.powermock.core.classloader.annotations.PrepareForTest
import org.powermock.modules.junit4.PowerMockRunner
import org.powermock.modules.junit4.PowerMockRunnerDelegate
import spock.lang.Specification
/**
 * @description ${description}*
 * @date 2021-11-24 10:11
 *
 * @author Lizhong
 */

@RunWith(PowerMockRunner.class)
@PrepareForTest([IDNumberUtils.class])
@PowerMockRunnerDelegate()
// @PowerMockIgnore(["javax.xml.*", "ch.qos.logback.*", "org.slf4j.*"])
class TestUtilsTest extends Specification {


    def "something something something something"() {
        PowerMockito.mockStatic(IDNumberUtils.class)

        GroovyMock(IDNumberUtils, global: true)
        TestUtils tu = new TestUtils()
        when: 'something something'
        def mocked = Mock(TestUtils)
        mocked.test(_) >> "return me"

        def x= tu.test(_)

        then: 'expect something'
        x == "return me"

    }
}